package com.gl.portal.system.repository;

import com.gl.portal.system.entity.SysArea;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface SysAreaRepository extends JpaRepository<SysArea, Long>, JpaSpecificationExecutor<SysArea> {

    List<SysArea> findByName(String name);

    int countByParentId(Long parentId);

    List<SysArea> findByParentIdAndName(Long parentId, String name);
}
